package com.wlyuan.open.scanner.utils.enums.named;

import com.wlyuan.core.marker.NamedValue;
import com.wlyuan.core.marker.NamedValueMap;
import com.wlyuan.core.named.PackageMode;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Map;

/**
 * @author lijing
 * @description
 */
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public enum PackageModeEnum implements NamedValue<Integer> {

    DISPERSE(1, PackageMode.BULK.getValue(), "散箱"),
    TRAY(2, PackageMode.TRAY.getValue(), "托盘或木箱"),
    ANOMALY(3, PackageMode.ANOMALOUS.getValue(), "托盘、木箱或不规则形状");

    private final Integer value;
    private final Integer newValue;
    private final String name;

    private static final Map<Integer, PackageModeEnum> MAP = new NamedValueMap<>(PackageModeEnum.class);

    public static PackageModeEnum fromValue(Integer value) {
        return MAP.get(value);
    }
}
